
cmake_minimum_required(VERSION 3.5)
project(example VERSION 1.0.0 LANGUAGES CXX)

set(LIBNURAFT ${PROJECT_SOURCE_DIR}/dep_libs/nuraft/lib/libnuraft.a)
include_directories(${PROJECT_SOURCE_DIR}/dep_libs/nuraft/include/libnuraft)

set(LIBSSL ssl)
set(LIBCRYPTO crypto)
set(LIBPTHREAD pthread)

set(LIBLEVELDB ${PROJECT_SOURCE_DIR}/dep_libs/leveldb/lib/libleveldb.a)
include_directories(${PROJECT_SOURCE_DIR}/dep_libs/leveldb/include)

include_directories(${PROJECT_SOURCE_DIR}/dep_libs/poco/include)


include_directories(${PROJECT_SOURCE_DIR}/include)


include(cmake/clangformat.cmake)


set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pessimizing-move")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

find_program(CLANG_FORMAT "clang-format")
IF (NOT CLANG_FORMAT)
  MESSAGE(FATAL_ERROR "clang-format not found")
ENDIF()

if (POLICY CMP0009)
  cmake_policy(SET CMP0009 NEW)
endif (POLICY CMP0009)
if (POLICY CMP0011)
  cmake_policy(SET CMP0011 NEW)
endif (POLICY CMP0011)


add_subdirectory(src)
